/****************************** Module Header ******************************\
 * Module Name:  IMail.cs
 * Module Version:  1.0.0 (2011-9-28)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This interface is used to rule the mail class. It define the 
 * common method for the mail class.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UCF.Core
{
    /// <summary>
    /// 邮件类接口
    /// <para>提供发送邮件的方法和邮件对象的属性</para>
    /// </summary>
    public interface IMail
    {
        /// <summary>
        /// 登录名，也就是发送邮件的邮箱
        /// </summary>
        string From { get; set; }

        /// <summary>
        /// 接收方邮件地址
        /// </summary>
        string To { get; set;}

        /// <summary>
        /// 邮件标题
        /// </summary>
        string Subject { get; set; }

        /// <summary>
        /// 邮件内容
        /// </summary>
        string Body { get; set; }

        /// <summary>
        /// 附件文件
        /// </summary>
        string Attachment { get; set; }

        /// <summary>
        /// 邮件编码
        /// </summary>
        string Encoding { get; set; }

        /// <summary>
        /// SMTP服务器地址
        /// </summary>
        string SmtpServer { get; set; }

        /// <summary>
        /// SMTP登录密码
        /// </summary>
        string Password { get; set; }

        /// <summary>
        /// 发送邮件
        /// </summary>
        void SendEmail();

        /// <summary>
        /// 添加收件人
        /// </summary>
        void AddTo();

        /// <summary>
        /// 添加抄送收件人
        /// </summary>
        void AddCC();

        /// <summary>
        /// 添加暗送收件人
        /// </summary>
        void AddBcc();

        /// <summary>
        /// 添加附件
        /// </summary>
        void AddAttachment();

        /// <summary>
        /// 测试SMTP服务器是否可用
        /// </summary>
        /// <param name="toEmail"></param>
        /// <returns></returns>
        bool TestSmtp(string toEmail);

    }
}
